﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MediumTrust.Default" %>

<!DOCTYPE html>
<html lang="en-US">
<head runat="server">
    <title>Create PDF documents or Word files (DOCX, RTF, XML, HTML) from ASP.NET Web Forms</title>
    <style>
        * {
            font-family: Calibri;
            color: #514E52;
            padding: 6px;
            box-sizing: border-box;
        }

        header {
            height: 80px;
            background: #F26522 url("./images/logo.svg") no-repeat left;
        }

        header a {
            height: 68px;
            display: block;
        }

        label, input, select, th, td { width: 150px; }

        label {
          display: inline-block;
          text-align: right;
        }

        label::after { content: ":"; }
        
        .aspNetHidden { padding: 0; }
    </style>
</head>
<body>
    <header><a href="https://www.gemboxsoftware.com/"></a></header>
    <form id="formInvoice" runat="server">
        <h1>Invoice</h1>
        <div>
            <asp:Label ID="lblNumber" runat="server" AssociatedControlId="txtNumber" Text="Number" />
            <asp:TextBox ID="txtNumber" runat="server" TextMode="Number" />
        </div>

        <div>
            <asp:Label ID="lblDate" runat="server" AssociatedControlId="txtDate" Text="Date" />
            <asp:TextBox ID="txtDate" runat="server" TextMode="Date" />
        </div>

        <div>
            <asp:Label ID="lblCompany" runat="server" AssociatedControlId="txtCompany" Text="Company" />
            <asp:TextBox ID="txtCompany" runat="server" TextMode="SingleLine" />
        </div>

        <asp:GridView ID="gridItems" runat="server" BorderColor="#BFBFBF" ShowHeaderWhenEmpty="true"
            AutoGenerateColumns="false" AutoGenerateDeleteButton="true" AutoGenerateEditButton="true"
            OnRowUpdating="gridItems_RowUpdating"
            OnRowEditing="gridItems_RowEditing"
            OnRowCancelingEdit="gridItems_RowCancelingEdit"
            OnRowDeleting="gridItems_RowDeleting">
            <HeaderStyle Font-Bold="true" Font-Size="Larger" />
            <Columns>
                <asp:BoundField DataField="Date" HeaderText="Date" DataFormatString="{0:d MMM yyyy}" />
                <asp:BoundField DataField="Hours" HeaderText="Hours" DataFormatString="{0:d}" />
                <asp:BoundField DataField="Unit" HeaderText="Unit (€/hour)" DataFormatString="{0:0.00}" />
                <asp:BoundField DataField="Price" HeaderText="Price" DataFormatString="{0:0.00}" ReadOnly="true" />
            </Columns>
        </asp:GridView>

        <div>
            <asp:Button ID="btnAddRow" runat="server" Text="Add Item" OnClick="btnAddRow_Click"/>
        </div>
        
        <div>
            <asp:Label ID="lblTotal" runat="server" AssociatedControlId="txtDate" Text="Total" Font-Bold="true" ForeColor="#F26522" Font-Size="Larger" />
            <asp:TextBox ID="txtTotal" runat="server" ReadOnly="true" Font-Bold="true" ForeColor="#F26522" Font-Size="Larger" />
        </div>

        <div>
            <asp:Label ID="lblFileFormat" runat="server" AssociatedControlId="ddlFileFormat" Text="File format" />
            <asp:DropDownList ID="ddlFileFormat" runat="server">
                <asp:ListItem Value=".docx">DOCX</asp:ListItem>
                <asp:ListItem Value=".pdf" Selected="true">PDF</asp:ListItem>
                <asp:ListItem Value=".html">HTML</asp:ListItem>
                <asp:ListItem Value=".mhtml">MHTML</asp:ListItem>
                <asp:ListItem Value=".rtf">RTF</asp:ListItem>
                <asp:ListItem Value=".xml">XML</asp:ListItem>
                <asp:ListItem Value=".txt">TXT</asp:ListItem>
            </asp:DropDownList>
        </div>

        <div>
            <asp:Button ID="btnCreateFile" runat="server" Text="Create Invoice" OnClick="btnCreateFile_Click" />
        </div>
    </form>
</body>
</html>